<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head><title>用户列表</title></head>
<body>
<h2>用户列表</h2>
<table border="1">
    <tr>
        <th>ID</th><th>姓名</th><th>年龄</th><th>邮箱</th><th>电话</th><th>操作</th>
    </tr>
    <c:forEach items="${users}" var="user">
        <tr>
            <td>${user.id}</td>
            <td>${user.name}</td>
            <td>${user.age}</td>
            <td>${user.email}</td>
            <td>${user.phone}</td>
            <td>
                <a href="/users/${user.id}/edit">编辑</a>
                <a href="/users/${user.id}/delete">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>

<!-- 分页 -->
<div>
    <c:if test="${currentPage > 1}">
        <a href="/users?pageNum=${currentPage - 1}&pageSize=5">上一页</a>
    </c:if>
    当前第 ${currentPage} 页 / 共 ${totalPages} 页
    <c:if test="${currentPage < totalPages}">
        <a href="/users?pageNum=${currentPage + 1}&pageSize=5">下一页</a>
    </c:if>
</div>

<h3>添加用户</h3>
<form action="/users" method="post">
    姓名：<input type="text" name="name"><br>
    年龄：<input type="number" name="age"><br>
    邮箱：<input type="text" name="email"><br>
    电话：<input type="text" name="phone"><br>
    <input type="submit" value="提交">
</form>
</body>
</html>